home *** CD-ROM | disk | FTP | other *** search
- Path: andrew.cmu.edu!elie+
- From: Elie Jean-Philippe <elie+@andrew.cmu.edu>
- Newsgroups: comp.lang.c
- Subject: loading a new process using exec()
- Date: Sun, 24 Mar 1996 02:47:51 -0500
- Organization: Carnegie Mellon, Pittsburgh, PA
- Message-ID: <0lJDsb200iol07bUU0@andrew.cmu.edu>
- NNTP-Posting-Host: po7.andrew.cmu.edu
-
- Hi all,
-
- I'm trying to load a program in a new process created using fork().
- I'm using the following code (under HP-UX, 9.0):
-
- char *cmd_args[] = {"test",NULL};
- if (execl(cmd_args[0],cmd_args) < 0) {
- printf("error loading program, error # is: %d\n",errno);
- exit(-1);
- }
- where errno = 14 (bad address)
- It would seem that cmd_args is not correctly set or, execl is not
- called correctly.
- Does anybody have some ideas about this ?
- Thanks in advance for any help.
-
- Elie.
-